﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class admin_qlintroduction : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void GridView1_RowCreated(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            e.Row.Attributes.Add("onmouseover", "this.originalstyle=this.style.backgroundColor;this.style.backgroundColor='#99ffcc'");
            e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=this.originalstyle;");
        }
    }

    protected void GridView1_RowEditing(object sender, GridViewEditEventArgs e)
    {
        e.Cancel = true;
        Label id = (Label)this.GridView1.Rows[e.NewEditIndex].Cells[0].FindControl("id");
        Label lang = (Label)this.GridView1.Rows[e.NewEditIndex].Cells[1].FindControl("lang");
        //Response.Write(id.Text);

        Response.Redirect("Default.aspx?page=edintroduction&id=" + id.Text + "&lang=" + lang.Text);
    }

    protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
    {
    }

    protected void addbt_Click(object sender, EventArgs e)
    {
        Int64 id = Common.createID();
        this.hdfID.Value = id.ToString();
        this.hdfContent.Value = this.fckContent.Value;
        Response.Write(id.ToString());
        this.SqlDataSource1.Insert();
        this.SqlDataSource1.DataBind();
    }
    protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
    {
        e.Cancel = true;
        Response.Write(Common.confirmDelete(null));
    }
}